﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;


namespace MOSS_Deploment_Wizard
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Hide();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {

                string myurl = textBox1.Text;
                SPSite mycollection = new SPSite(myurl);
                label2.Text = mycollection.ContentDatabase.Name.ToString() + " " + mycollection.ContentDatabase.DiskSizeRequired.ToString();

            }
            catch (Exception dberr)
            {
                label2.Text = dberr.Message.ToString();
                MessageBox.Show(dberr.Message.ToString());
            }

        }

        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Written by Duane Wolff, go to http://deploymentwizard.codeplex.com for updates");
        }

        private void helpToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start(@"C:\Users\%USERNAME%\Desktop\help.txt");
        }

    }
}
